﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AiFrame.InterfaceLib.MVP;
using AiFrameDemo.Contacts.Lib.Views;

namespace AiFrameDemo.StartScreen.WinForms.Windows
{
    public partial class StartFrame : UserControl, IWindow
    {
        public StartFrame()
        {
            InitializeComponent();
            Dock = DockStyle.Fill;
        }

        public void RefreshView()
        {
            // Refresh actions here
        }

        public void SetFree()
        {
            this.Dispose();
        }

        public void SetParentWindow(Control parent)
        {
            this.Parent = parent;
        }

        public void BringWindowToFront()
        {
            this.BringToFront();
        }

        public string GetCaption()
        {
            return "Startscreen";
        }

        private void newContactLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var viewFactory = StartScreenRegistry.Instance.CoreInterface.FactoryManager.GetFactory<IContactViewFactoryExt>();
            var dataView = viewFactory.CreateContactDataView();
            dataView.ShowView();
        }
    }
}
